home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 January / Disc 3 / Amethyst.iso / live / usr / lib / rpm-3.0.6 / brp-strip-comment-note < prev    next >
Encoding:
Text File  |  2001-04-06  |  584 b   |  18 lines

  1. #!/bin/sh
  2. # If using normal root, avoid changing anything.
  3. if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
  4.     exit 0
  5. fi
  6.  
  7. # Strip .comment and .note sections (the latter only if it is not allocated)
  8. # for already stripped elf files in the build root
  9. for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
  10.     sed -n -e 's/^\(.*\):[     ]*ELF.*, stripped/\1/p'`; do
  11.     note="-R .note"
  12.     if objdump -h $f | grep '^[     ]*[0-9]*[     ]*.note[     ]' -A 1 | \
  13.         grep ALLOC >/dev/null; then
  14.         note=
  15.     fi
  16.     strip -R .comment $note $f || :
  17. done
  18.